package com.mooc.lib_user.ui.user

import com.mooc.lib_network.entity.BaseRepository
import com.mooc.lib_network.entity.NetResult
import com.mooc.lib_network.entity.RetrofitSingle
import com.mooc.lib_user.ApiService
import com.mooc.lib_user.model.UserValuesEntity

class UserRepo : BaseRepository() {

    suspend fun userValues(userId : Int):NetResult<UserValuesEntity>{
        return requestCall (call = {requestUser(userId)})
    }

    suspend fun requestUser(userId : Int):NetResult<UserValuesEntity>{
        return handlerResponse(
            RetrofitSingle.instance().getRetrofit().create(ApiService::class.java)
                .requestUserValues(userId)
        )
    }

}